package com.xmall.define.dict;

import com.xmall.annotation.Dict;

/**
 * 支付方式
 */
@Dict
public enum PayTypeEnum {

    BALANCE("余额", 0), WE_CHAT("微信", 1), ALI_PAY("支付宝", 2);

    private String name;

    private Integer type;

    PayTypeEnum(String name, Integer type) {
        this.name = name;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public static String getNameByType(Integer type) {
        for (PayTypeEnum value : values()) {
            if(value.getType() == type) {
                return value.getName();
            }
        }
        return "";
    }
}
